package com.test.controller;

import com.test.model.Student;
import com.test.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @Author：徐志荣
 * @Date：2023/6/7 下午 7:43
 */
@Controller
public class StudentController {

    //1. 使用属性注入的方式 获取Bean
    @Autowired
   private StudentService studentService;
  //  private final StudentService studentService;

    public void sayHi(){
        //调用service方法
        studentService.sayHi();
    }
}
